//GA SA / MPI / rastrigin
//$Id: rastrigin_ga_sa_mpi.cpp 395 2010-03-26 14:01:03Z Oleg.Bulychov $

#include "stdafx.h"


#include "../../ga/rastrigin_ga.h"
#include "../../sa/rastrigin_sa.h"
#include "solvers/hybrids/ga_sa/ga_sa_mpi.h"
#include "src/heo/include/run_mpi.h"

typedef Rastrigin_Problem  TProblem;
typedef Rastrigin_Solution TSolution;
typedef Rastrigin_Config   TConfig;

typedef Environment<TProblem, TSolution, TConfig>           TEnvironment;

typedef struct GA_Traits<TEnvironment, validator_ga_sa_tag> TTraits;

typedef GA_MPI<TTraits>                                     TSolver;

static struct ga_register
{
    ga_register()
    {
        TSolver::register_Selection< ga::selection::tournament_selection >();
        TSolver::register_Selection< ga::selection::roulette_selection >();
        TSolver::register_Selection< ga::selection::random_selection >();

        TSolver::register_Operator< ga::inter_operator::crossover>();
        TSolver::register_Operator< ga::inter_operator::mutation>();
        TSolver::register_Operator< ga::inter_operator::sa>();
    }
} reg;

int main(int argc, char* argv[])
{
    return Run_MPI<TSolver>(argc, argv);
}

